//  引入 定义的字段变量
import { SET_NICKNAME, SET_USERNAME } from "../actionTypes"
// 定义初始值
const initState = "nickname"
// 逻辑在下面写 
export default (state = initState, action) => {
    const { type, data } = action
    switch (type) {
        case SET_NICKNAME:
            return  [data , ...state]
        case SET_USERNAME:
            return  [data , ...state]
        default:
            return  state ;
    }
}